package hihocoder;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.Queue;
import java.util.Scanner;

/**
 * 
 */

/**判断一个图是不是二分图
 * @author zhongfang
 *
 */
public class 二分图一二分图判定 {
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner scanner=new Scanner(System.in);
		int T=scanner.nextInt();
		while (T-->0) {
			int N=scanner.nextInt();
			int M=scanner.nextInt();
			Map<Integer, ArrayList<Integer>> edge1=new HashMap<>(N);//所有无向边成对存储在里面
			for (int i = 0; i < M; i++) {
				int x=scanner.nextInt();
				int y=scanner.nextInt();
				if(edge1.containsKey(x)){
					edge1.get(x).add(y);
				}else {
					ArrayList<Integer> list=new ArrayList<>();
					list.add(y);
					edge1.put(x, list);
				}
				if(edge1.containsKey(y)){
					edge1.get(y).add(x);
				}else {
					ArrayList<Integer> list=new ArrayList<>();
					list.add(x);
					edge1.put(y, list);
				}
			}
			int[] color=new int[N+1];
			color[1]=1;//第一个点选第一种颜色，第二种颜色为2，0为未染色
			boolean wrongTag=false;
			Queue<Integer> toDeal=new ArrayDeque<>(N);//存储初次染色的点，每个点最多进去一次
			toDeal.offer(1);
			while (!wrongTag&&!toDeal.isEmpty()) {
				int i=toDeal.poll();
				ArrayList<Integer> list=edge1.get(i);//是否有的点没有边？？？
				if(list==null){
					break;
				}
				for (Integer integer : list) {//它的所有邻居
					if(color[integer]==0){//没有被染色，则染成另一种颜色
						color[integer]=3-color[i];
						toDeal.offer(integer);
					}else if (color[integer]==color[i]) {
						wrongTag=true;
						break;
					}
				}
			}
			for (int i = 1; !wrongTag&&i < color.length; i++) {
				if(color[i]==0){
					wrongTag=true;
				}
			}
			if(wrongTag){
				System.out.println("Wrong");
			}else {
				System.out.println("Correct");
			}
		}
	}

}
